package com.example.springcloudsentinelgateway.controller;

import com.alibaba.csp.sentinel.annotation.SentinelResource;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.*;

/**
 * @createBy guoqiang
 * @createTime 2024/7/16
 * @describe
 */
@RequestMapping("/sgateway")
@RestController
@Tag(name="sentinel+gateway")
public class SentinelGatewayController {
    /****@SentinelResource 注解用来标识资源是否被限流、降级，如果不加该注解服务也会在sentinel中监控到****/
    @SentinelResource(value = "test")
    @GetMapping("/test")
    @Operation(summary = "测试gateway的Sentinel")
    public String test(){
        return  "我是测试@SentinelResource的接口";
    }
}
